<template>
    <div class="min-table" style="overflow: auto;">
        <div v-for="(t,i) in tables" :key="i">
          <el-table :data="t" border style="min-width: 1290px" :header-cell-style="{'background':'#eef1f6','color':'#1f2d3d'}">
              	<template v-for="item  in previewDataObj">
                  	<el-table-column :prop="item.key" :label="item.value"></el-table-column>
              	</template>
          </el-table>
        </div>
    </div>
</template>
<script>
import api from "../../../api/api";
import util from "../../../common/util";

export default {
  props: {
    table: null,
    data: null
  },
  data() {
    return {
      previewDataObj: [],
      show: true,
      tables: []
    };
  },
  created() {
    if (this.data) {
      this.previewDataObj = this.data;
      this.previewDataObj = this.previewDataObj.sort((a, b) => {
        return a.index - b.index;
      })
    }
    if (this.table && this.table instanceof Array) {
      let first = this.table[0]
      if (first instanceof Array) {
        this.tables = this.table
      } else {
        this.tables.push(this.table)
      }
    }
  },
  mounted() {}
};
</script>
<style>
.min-table .el-table__row td {
  padding: 4px 8px;
}
.min-table .el-table__row td > div {
  padding: 0 5px;
}
</style>

